$("form input:submit").click(function () {
    $.ajax({
        type: 'POST',
        dataType:'json',
        data:$("form input:eq(2)").serializeArray(),
        url:'/validate_code/check',
        success:function (data) {
            console.log('1'+data.code);
            if (data.code==200) {
                console.log($("form input:not(:eq(2))").serializeArray());
                $.ajax({
                    type: 'POST',
                    dataType:'json',
                    data:$("form input:not(:eq(2))").serializeArray(),
                    url:'/user/username_login',
                    success:function (data) {
                        console.log(data.code);

                       if (data.code==200||data.code==201){
                           window.location.href="/video_back/upload";
                       }else {
                           alert(data.msg)
                       }
                    },
                    error:function (data) {
                        console.log('/user/username_login');
                        console.log(data);
                    }
                })
            }else {
                alert("验证码不正确！")
            }

        },
        error:function (data) {

            console.log("error");
        }
    })
    return false
})





